package cn.com.yl.index;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class indexController {
    @Autowired
    protected JdbcTemplate jdbcTemplate;
    
    @RequestMapping(value="index" , method=RequestMethod.GET)
    public ModelAndView indexHandler(HttpServletRequest request){
    	ModelAndView mav = new ModelAndView("index");
    	int a = jdbcTemplate.queryForInt("select count(*) from tc_user");
    	System.out.println(a);
    	return mav;
    }
    @RequestMapping(value="404" , method=RequestMethod.GET)
    public ModelAndView index404Handler(HttpServletRequest request){
    	ModelAndView mav = new ModelAndView("404");
    	return mav;
    }
}
